package com.fxp.project.jiuselu.web.models.shareprofit.mapper;

import com.fxp.project.jiuselu.web.models.shareprofit.entity.JslShareProfitRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fxp.project.jiuselu.web.models.shareprofit.vo.StatisticUserProfitMoneyVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;

/**
 * <p>
 * 分润记录表 Mapper 接口
 * </p>
 *
 * @author M_
 */
public interface JslShareProfitRecordMapper extends BaseMapper<JslShareProfitRecord> {

    /**
     * 批量插入
     * @param recordList
     */
    void insertBatch(@Param("recordList") List<JslShareProfitRecord> recordList) ;

    /**
     * 通过userid 统计其分润金额
     * @return
     */
    List<StatisticUserProfitMoneyVo> statisticsUserProfitMoney(@Param("userIdList") List<Long> userIdList);

    /**
     * 通过userId 查询分润纪录
     * @param userId
     * @return
     */
    List<JslShareProfitRecord> selectRecordByUserId(@Param("userId") Long userId);

    List<JslShareProfitRecord> selectRecordByUserIdAndLevel(@Param("userId") Long userId,@Param("level") Integer level);

    List<JslShareProfitRecord> selectDelayByUserIdAndLevel(@Param("userId") Long userId,@Param("level") Integer level);
}
